using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

public sealed class RssConfiguration : ConfigurationSection
{
    public const string SectionName = "rssConfiguration";
    
    private const string FeedGuidFieldNameAttributeName = "FeedGuidFieldName";
    public const string FeedGuidFieldNameDefaultValue = "FeedId";

    private const string HandlerUrlAttributeName = "HandlerUrl";
    public const string HandlerUrlDefaultValue = "RssFeedHandler.aspx";

    private const string AlwaysInFeedTypeAttributeName = "AlwaysInFeedType";
    public const string AlwaysInFeedTypeDefaultValue = "Track";

    private const string OnSaleTypeAttributeName = "OnSaleType";
    public const string OnSaleTypeDefaultValue = "Sale";

    private const string InStockTypeAttributeName = "InStockType";
    public const string InStockTypeDefaultValue = "Stock";

    private const string MaxNewItemsAttributeName = "MaxNewItems";
    public const string MaxNewItemsDefaultValue = "30";

    private const string FeedDescriptionAttributeName = "FeedDescription";
    public const string FeedDescriptionDefaultValue = "Default Description";

    private const string ProductUrlAttributeName = "ProductUrl";
    public const string ProductUrlDefaultValue = "Products.aspx";

    private const string CatalogFieldAttributeName = "CatalogField";
    public const string CatalogFieldDefaultValue = "Catalog";

    private const string ProductIdFieldAttributeName = "ProductIdField";
    public const string ProductIdFieldDefaultValue = "ProductID";

    private const string ProductDescriptionPropertyAttributeName = "ProductDescriptionProperty";
    public const string ProductDescriptionPropertyDefaultValue = "description";

    [ConfigurationProperty(FeedGuidFieldNameAttributeName, DefaultValue = FeedGuidFieldNameDefaultValue)]
    public string FeedGuidFieldName
    {
        get { return (string)this[FeedGuidFieldNameAttributeName]; }
        set { this[FeedGuidFieldNameAttributeName] = value; }
    }

    [ConfigurationProperty(HandlerUrlAttributeName, DefaultValue = HandlerUrlDefaultValue)]
    public string HandlerUrl
    {
        get { return (string)this[HandlerUrlAttributeName]; }
        set { this[HandlerUrlAttributeName] = value; }
    }

    [ConfigurationProperty(AlwaysInFeedTypeAttributeName, DefaultValue = AlwaysInFeedTypeDefaultValue)]
    public string AlwaysInFeedType
    {
        get { return (string)this[AlwaysInFeedTypeAttributeName]; }
        set { this[AlwaysInFeedTypeAttributeName] = value; }
    }

    [ConfigurationProperty(OnSaleTypeAttributeName, DefaultValue = OnSaleTypeDefaultValue)]
    public string OnSaleType
    {
        get { return (string)this[OnSaleTypeAttributeName]; }
        set { this[OnSaleTypeAttributeName] = value; }
    }

    [ConfigurationProperty(InStockTypeAttributeName, DefaultValue = InStockTypeDefaultValue)]
    public string InStockType
    {
        get { return (string)this[InStockTypeAttributeName]; }
        set { this[InStockTypeAttributeName] = value; }
    }

    [ConfigurationProperty(MaxNewItemsAttributeName, DefaultValue = MaxNewItemsDefaultValue)]
    public string MaxNewItems
    {
        get { return (string)this[MaxNewItemsAttributeName]; }
        set { this[MaxNewItemsAttributeName] = value; }
    }

    [ConfigurationProperty(FeedDescriptionAttributeName, DefaultValue = FeedDescriptionDefaultValue)]
    public string FeedDescription
    {
        get { return (string)this[FeedDescriptionAttributeName]; }
        set { this[FeedDescriptionAttributeName] = value; }
    }

    [ConfigurationProperty(ProductUrlAttributeName, DefaultValue = ProductUrlDefaultValue)]
    public string ProductUrl
    {
        get { return (string)this[ProductUrlAttributeName]; }
        set { this[ProductUrlAttributeName] = value; }
    }

    [ConfigurationProperty(CatalogFieldAttributeName, DefaultValue = CatalogFieldDefaultValue)]
    public string CatalogField
    {
        get { return (string)this[CatalogFieldAttributeName]; }
        set { this[CatalogFieldAttributeName] = value; }
    }

    [ConfigurationProperty(ProductIdFieldAttributeName, DefaultValue = ProductIdFieldDefaultValue)]
    public string ProductIdField
    {
        get { return (string)this[ProductIdFieldAttributeName]; }
        set { this[ProductIdFieldAttributeName] = value; }
    }

    [ConfigurationProperty(ProductDescriptionPropertyAttributeName, DefaultValue = ProductDescriptionPropertyDefaultValue)]
    public string ProductDescriptionProperty
    {
        get { return (string)this[ProductDescriptionPropertyAttributeName]; }
        set { this[ProductDescriptionPropertyAttributeName] = value; }
    }
}

